# PyPDF2的使用


from PyPDF2 import PdfFileReader, PdfFileWriter

pdf_reader = PdfFileReader(r'INV1.pdf')
for page in range(pdf_reader.getNumPages()):
    pdf_writer = PdfFileWriter()
    pdf_writer.addPage(pdf_reader.getPage(page))
    with open('INV1-{}.pdf'.format(page + 1), 'wb') as out:
        pdf_writer.write(out)
